#include "../header/card.h"

Card::CardPoint Card::getPoint() const {
    return point;
}

const Card& Card::setName(const char* x) {
    name = x; return *this;
}

const char* Card::getName() const noexcept {
    return name;
}

const Card& Card::setDesc(const char* x) {
    desc = x;
    return *this;
}

const char* Card::getDesc() const {
    return desc;
}

const Card& Card::setColor(CardColor c) {
    color = c;
    return *this;
}

Card::CardColor Card::getColor() const {
    return color;
}

const Card& Card::setCate(Category c) {
    cate = c;
    return *this;
}

Card::Category Card::getCate() const {
    return cate;
}

const Card& Card::setType(Type t) {
    type = t;
    return *this;
}

Card::Type Card::getType() const {
    if(oldType != Card::Type::None) return oldType;
    return type;
}


bool Card::operator == (const Card& card) const {
    return point == card.point && color == card.color;
}

const Card *Card::cleanOldType() {
    oldType = Card::Type::None;
    return this;
}
